import requests


url = 'https://www.baidu.com/'

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
                  "Chrome/54.0.2840.99 Safari/537.36 "
}

cookies = {
    'Cookie': 'BIDUPSID=D4F950DB42840083ED61D6936AF486DE; PSTM=1645755948; BD_UPN=123253; '
              'BAIDUID=3E21ABC174924ED5295EFCFCC88F4C7A:FG=1; '
              'BDUSS=BQcEszdmtIY0g1Z3h2QkJJRjRpQy1udlJQN0dVQ3lZdWRHeEhsN3d'
              '-endjTkppRVFBQUFBJCQAAAAAAAAAAAEAAAA6KJBUycbBvLXEX7Cu0MS7sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPDjqmLw46piZz; BDUSS_BFESS=BQcEszdmtIY0g1Z3h2QkJJRjRpQy1udlJQN0dVQ3lZdWRHeEhsN3d-endjTkppRVFBQUFBJCQAAAAAAAAAAAEAAAA6KJBUycbBvLXEX7Cu0MS7sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPDjqmLw46piZz; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; MCITY=-:; ab_sr=1.0.1_NjQxOGY2ZGI4NzBkYzUzZGYyZmI4MTYzMjZiZTQwMmMyOTBjZjE4ZTE3ZGM2ZWQ4NDVmZGNkZWQ1ZDc4MzkzMjY2OTc5ZmMxYTM5YjA0YTc2NDJmMzI3MjNlOThjY2NmNTQ5MzhmODY2OWExNGYzZWNiNTQ4N2U0OGNlMmFjMGMzZGViMTU3ZTA2ZTQ1MGI0YmNiZTUzMGMyNzUxNGZhMw==; H_PS_PSSID=36542_36465_36255_36824_36413_36955_36950_36167_36917_36806_36746_26350_36862; H_PS_645EC=b6a83DOjFJ23JKXzK2Twpdc45telJOxbRAcI/c6Ogiu4hBESLjYDEsreoD8; BA_HECTOR=0h0k2h048l840h0g8022k1661heegmu17; delPer=0; BD_CK_SAM=1; PSINO=1; ZFY=u4I6ABowEomn7rizbvlhhHwaGP3n9Snvka6cGReevUA:C; BD_HOME=1 '
}
response = requests.get(url=url, headers=headers, cookies=cookies)
html = response.text
print(html)

"""
cookies     是整个用户的信息的字段
    cookies 的生成要具体情况具体分析
        服务器生成
        浏览器生成
        js生成
cookie       是片段信息

服务器之后针对特定的cookie片段进行校验
"""

